package sopt.dev.util;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class StringUtil {

	static SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");

	public static String dateToString(Date date) {
		return format.format(date);
	}

	public static Date stringToDate(String dateString) {

		try {
			return format.parse(dateString);
		} catch (ParseException e) {
			e.printStackTrace();
		}
		return null;
	}
	
	public static String parseCurrency(String currency) {
		
		int startOffset = currency.length() - 3;
		
		return currency.substring(startOffset);
	}


}
